{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Boson Sampling with MPS\n",
    "\n",
    "In this notebook, we explain how to use the MPS (Matrix Product State) backend to simulate a linear circuit. MPS simulation is based on a type of tensor network simulation, which gives an approximation of the output states [[1]](#References) [[2]](#References). It does the computation on each component of the circuits one-by-one, and not on the whole unitary. The states are represented by tensors, which are then updated at each component. These tensors can be seen as a big set of matrices, and the approximation is done by chosing the dimension of these matrices, called the *bond dimension*. For this example, we simulate a simple boson sampling problem, with 6 modes and 3 photons [[3]](#References)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import perceval as pcvl\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Definition of the circuit\n",
    "\n",
    "Just like in the Boson Sampling notebook, we generate a Haar-random unitary and its decomposition in a circuit :"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6  modes triangular Boson Sampler :\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
       "     width=\"3321.25\" height=\"406.25\" viewBox=\"-28.5 0 2657.0 325.0\">\n",
       "<defs>\n",
       "</defs>\n",
       "<path d=\"M10,25 L25,25\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M10,75 L25,75\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M10,125 L25,125\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M10,175 L25,175\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M10,225 L25,225\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M10,275 L25,275\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M25,275 L75,275\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M30,290 L39,290 L53,260 L44,260 L30,290 L39,290 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"47\" y=\"288\" font-size=\"7\" text-anchor=\"start\">Φ=1.265255</text>\n",
       "<path d=\"M25,225 L75,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M30,240 L39,240 L53,210 L44,210 L30,240 L39,240 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"47\" y=\"238\" font-size=\"7\" text-anchor=\"start\">Φ=2.858772</text>\n",
       "<path d=\"M25,175 L75,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M30,190 L39,190 L53,160 L44,160 L30,190 L39,190 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"47\" y=\"188\" font-size=\"7\" text-anchor=\"start\">Φ=3.402583</text>\n",
       "<path d=\"M25,125 L75,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M30,140 L39,140 L53,110 L44,110 L30,140 L39,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"47\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=1.851956</text>\n",
       "<path d=\"M25,75 L75,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M30,90 L39,90 L53,60 L44,60 L30,90 L39,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"47\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=2.413235</text>\n",
       "<path d=\"M25,25 L75,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M30,40 L39,40 L53,10 L44,10 L30,40 L39,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"47\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=0.39409</text>\n",
       "<path d=\"M75,25 L103,25 L122,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M128,44 L147,25 L175,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M75,75 L103,75 L122,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M128,56 L147,75 L175,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M100,43 L150,43 L150,57 L100,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"125\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"125\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M100,43 L150,43 L150,47 L100,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M143,50 L153,50 L153,60 L143,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"148\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M175,25 L225,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M180,40 L189,40 L203,10 L194,10 L180,40 L189,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"197\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=2.758766</text>\n",
       "<path d=\"M175,75 L225,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M225,25 L253,25 L272,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M278,44 L297,25 L325,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M225,75 L253,75 L272,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M278,56 L297,75 L325,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M250,43 L300,43 L300,57 L250,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"275\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"275\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M250,43 L300,43 L300,47 L250,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M293,50 L303,50 L303,60 L293,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"298\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M325,75 L375,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M330,90 L339,90 L353,60 L344,60 L330,90 L339,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"347\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=3.479159</text>\n",
       "<path d=\"M75,125 L375,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M375,75 L403,75 L422,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M428,94 L447,75 L475,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M375,125 L403,125 L422,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M428,106 L447,125 L475,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M400,93 L450,93 L450,107 L400,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"425\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"425\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M400,93 L450,93 L450,97 L400,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M443,100 L453,100 L453,110 L443,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"448\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M475,75 L525,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M480,90 L489,90 L503,60 L494,60 L480,90 L489,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"497\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=1.947194</text>\n",
       "<path d=\"M475,125 L525,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M525,75 L553,75 L572,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M578,94 L597,75 L625,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M525,125 L553,125 L572,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M578,106 L597,125 L625,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M550,93 L600,93 L600,107 L550,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"575\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"575\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M550,93 L600,93 L600,97 L550,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M593,100 L603,100 L603,110 L593,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"598\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M625,125 L675,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M630,140 L639,140 L653,110 L644,110 L630,140 L639,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"647\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=2.84937</text>\n",
       "<path d=\"M325,25 L625,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M625,25 L653,25 L672,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M678,44 L697,25 L725,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M625,75 L653,75 L672,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M678,56 L697,75 L725,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M650,43 L700,43 L700,57 L650,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"675\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"675\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M650,43 L700,43 L700,47 L650,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M693,50 L703,50 L703,60 L693,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"698\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M725,25 L775,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M730,40 L739,40 L753,10 L744,10 L730,40 L739,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"747\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=1.169331</text>\n",
       "<path d=\"M725,75 L775,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M775,25 L803,25 L822,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M828,44 L847,25 L875,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M775,75 L803,75 L822,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M828,56 L847,75 L875,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M800,43 L850,43 L850,57 L800,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"825\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"825\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M800,43 L850,43 L850,47 L800,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M843,50 L853,50 L853,60 L843,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"848\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M875,75 L925,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M880,90 L889,90 L903,60 L894,60 L880,90 L889,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"897\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=2.251856</text>\n",
       "<path d=\"M75,175 L675,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M675,125 L703,125 L722,144\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M728,144 L747,125 L775,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M675,175 L703,175 L722,156\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M728,156 L747,175 L775,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M700,143 L750,143 L750,157 L700,157 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"725\" y=\"185\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"725\" y=\"126\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M700,143 L750,143 L750,147 L700,147 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M743,150 L753,150 L753,160 L743,160 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"748\" y=\"157\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M775,125 L825,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M780,140 L789,140 L803,110 L794,110 L780,140 L789,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"797\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=1.194179</text>\n",
       "<path d=\"M775,175 L825,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M825,125 L853,125 L872,144\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M878,144 L897,125 L925,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M825,175 L853,175 L872,156\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M878,156 L897,175 L925,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M850,143 L900,143 L900,157 L850,157 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"875\" y=\"185\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"875\" y=\"126\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M850,143 L900,143 L900,147 L850,147 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M893,150 L903,150 L903,160 L893,160 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"898\" y=\"157\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M925,175 L975,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M930,190 L939,190 L953,160 L944,160 L930,190 L939,190 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"947\" y=\"188\" font-size=\"7\" text-anchor=\"start\">Φ=5.333985</text>\n",
       "<path d=\"M925,75 L953,75 L972,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M978,94 L997,75 L1025,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M925,125 L953,125 L972,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M978,106 L997,125 L1025,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M950,93 L1000,93 L1000,107 L950,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"975\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"975\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M950,93 L1000,93 L1000,97 L950,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M993,100 L1003,100 L1003,110 L993,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"998\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1025,75 L1075,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1030,90 L1039,90 L1053,60 L1044,60 L1030,90 L1039,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1047\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=5.036737</text>\n",
       "<path d=\"M1025,125 L1075,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1075,75 L1103,75 L1122,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1128,94 L1147,75 L1175,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1075,125 L1103,125 L1122,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1128,106 L1147,125 L1175,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1100,93 L1150,93 L1150,107 L1100,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1125\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1125\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1100,93 L1150,93 L1150,97 L1100,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1143,100 L1153,100 L1153,110 L1143,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1148\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1175,125 L1225,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1180,140 L1189,140 L1203,110 L1194,110 L1180,140 L1189,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1197\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=2.642193</text>\n",
       "<path d=\"M875,25 L1175,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1175,25 L1203,25 L1222,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1228,44 L1247,25 L1275,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1175,75 L1203,75 L1222,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1228,56 L1247,75 L1275,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1200,43 L1250,43 L1250,57 L1200,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1225\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1225\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1200,43 L1250,43 L1250,47 L1200,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1243,50 L1253,50 L1253,60 L1243,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1248\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1275,25 L1325,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1280,40 L1289,40 L1303,10 L1294,10 L1280,40 L1289,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1297\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=2.172429</text>\n",
       "<path d=\"M1275,75 L1325,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1325,25 L1353,25 L1372,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1378,44 L1397,25 L1425,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1325,75 L1353,75 L1372,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1378,56 L1397,75 L1425,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1350,43 L1400,43 L1400,57 L1350,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1375\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1375\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1350,43 L1400,43 L1400,47 L1350,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1393,50 L1403,50 L1403,60 L1393,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1398\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1425,75 L1475,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1430,90 L1439,90 L1453,60 L1444,60 L1430,90 L1439,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1447\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=2.095071</text>\n",
       "<path d=\"M75,225 L975,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M975,175 L1003,175 L1022,194\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1028,194 L1047,175 L1075,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M975,225 L1003,225 L1022,206\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1028,206 L1047,225 L1075,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1000,193 L1050,193 L1050,207 L1000,207 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1025\" y=\"235\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1025\" y=\"176\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1000,193 L1050,193 L1050,197 L1000,197 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1043,200 L1053,200 L1053,210 L1043,210 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1048\" y=\"207\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1075,175 L1125,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1080,190 L1089,190 L1103,160 L1094,160 L1080,190 L1089,190 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1097\" y=\"188\" font-size=\"7\" text-anchor=\"start\">Φ=5.661671</text>\n",
       "<path d=\"M1075,225 L1125,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1125,175 L1153,175 L1172,194\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1178,194 L1197,175 L1225,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1125,225 L1153,225 L1172,206\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1178,206 L1197,225 L1225,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1150,193 L1200,193 L1200,207 L1150,207 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1175\" y=\"235\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1175\" y=\"176\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1150,193 L1200,193 L1200,197 L1150,197 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1193,200 L1203,200 L1203,210 L1193,210 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1198\" y=\"207\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1225,225 L1275,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1230,240 L1239,240 L1253,210 L1244,210 L1230,240 L1239,240 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1247\" y=\"238\" font-size=\"7\" text-anchor=\"start\">Φ=0.738002</text>\n",
       "<path d=\"M1225,125 L1253,125 L1272,144\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1278,144 L1297,125 L1325,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1225,175 L1253,175 L1272,156\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1278,156 L1297,175 L1325,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1250,143 L1300,143 L1300,157 L1250,157 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1275\" y=\"185\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1275\" y=\"126\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1250,143 L1300,143 L1300,147 L1250,147 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1293,150 L1303,150 L1303,160 L1293,160 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1298\" y=\"157\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1325,125 L1375,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1330,140 L1339,140 L1353,110 L1344,110 L1330,140 L1339,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1347\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=5.273074</text>\n",
       "<path d=\"M1325,175 L1375,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1375,125 L1403,125 L1422,144\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1428,144 L1447,125 L1475,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1375,175 L1403,175 L1422,156\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1428,156 L1447,175 L1475,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1400,143 L1450,143 L1450,157 L1400,157 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1425\" y=\"185\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1425\" y=\"126\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1400,143 L1450,143 L1450,147 L1400,147 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1443,150 L1453,150 L1453,160 L1443,160 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1448\" y=\"157\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1475,175 L1525,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1480,190 L1489,190 L1503,160 L1494,160 L1480,190 L1489,190 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1497\" y=\"188\" font-size=\"7\" text-anchor=\"start\">Φ=3.543207</text>\n",
       "<path d=\"M1475,75 L1503,75 L1522,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1528,94 L1547,75 L1575,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1475,125 L1503,125 L1522,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1528,106 L1547,125 L1575,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1500,93 L1550,93 L1550,107 L1500,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1525\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1525\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1500,93 L1550,93 L1550,97 L1500,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1543,100 L1553,100 L1553,110 L1543,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1548\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1575,75 L1625,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1580,90 L1589,90 L1603,60 L1594,60 L1580,90 L1589,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1597\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=4.449777</text>\n",
       "<path d=\"M1575,125 L1625,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1625,75 L1653,75 L1672,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1678,94 L1697,75 L1725,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1625,125 L1653,125 L1672,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1678,106 L1697,125 L1725,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1650,93 L1700,93 L1700,107 L1650,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1675\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1675\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1650,93 L1700,93 L1700,97 L1650,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1693,100 L1703,100 L1703,110 L1693,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1698\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1725,125 L1775,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1730,140 L1739,140 L1753,110 L1744,110 L1730,140 L1739,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1747\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=3.302943</text>\n",
       "<path d=\"M1425,25 L1725,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1725,25 L1753,25 L1772,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1778,44 L1797,25 L1825,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1725,75 L1753,75 L1772,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1778,56 L1797,75 L1825,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1750,43 L1800,43 L1800,57 L1750,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1775\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1775\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1750,43 L1800,43 L1800,47 L1750,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1793,50 L1803,50 L1803,60 L1793,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1798\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1825,25 L1875,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1830,40 L1839,40 L1853,10 L1844,10 L1830,40 L1839,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1847\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=4.02537</text>\n",
       "<path d=\"M1825,75 L1875,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1875,25 L1903,25 L1922,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1928,44 L1947,25 L1975,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1875,75 L1903,75 L1922,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1928,56 L1947,75 L1975,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1900,43 L1950,43 L1950,57 L1900,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1925\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1925\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1900,43 L1950,43 L1950,47 L1900,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1943,50 L1953,50 L1953,60 L1943,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1948\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1975,75 L2025,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1980,90 L1989,90 L2003,60 L1994,60 L1980,90 L1989,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1997\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=0.249399</text>\n",
       "<path d=\"M75,275 L1275,275\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1275,225 L1303,225 L1322,244\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1328,244 L1347,225 L1375,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1275,275 L1303,275 L1322,256\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1328,256 L1347,275 L1375,275\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1300,243 L1350,243 L1350,257 L1300,257 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1325\" y=\"285\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1325\" y=\"226\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1300,243 L1350,243 L1350,247 L1300,247 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1343,250 L1353,250 L1353,260 L1343,260 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1348\" y=\"257\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1375,225 L1425,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1380,240 L1389,240 L1403,210 L1394,210 L1380,240 L1389,240 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1397\" y=\"238\" font-size=\"7\" text-anchor=\"start\">Φ=6.238378</text>\n",
       "<path d=\"M1375,275 L1425,275\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1425,225 L1453,225 L1472,244\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1478,244 L1497,225 L1525,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1425,275 L1453,275 L1472,256\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1478,256 L1497,275 L1525,275\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1450,243 L1500,243 L1500,257 L1450,257 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1475\" y=\"285\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1475\" y=\"226\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1450,243 L1500,243 L1500,247 L1450,247 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1493,250 L1503,250 L1503,260 L1493,260 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1498\" y=\"257\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1525,275 L1575,275\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1530,290 L1539,290 L1553,260 L1544,260 L1530,290 L1539,290 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1547\" y=\"288\" font-size=\"7\" text-anchor=\"start\">Φ=2.976814</text>\n",
       "<path d=\"M1525,175 L1553,175 L1572,194\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1578,194 L1597,175 L1625,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1525,225 L1553,225 L1572,206\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1578,206 L1597,225 L1625,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1550,193 L1600,193 L1600,207 L1550,207 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1575\" y=\"235\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1575\" y=\"176\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1550,193 L1600,193 L1600,197 L1550,197 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1593,200 L1603,200 L1603,210 L1593,210 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1598\" y=\"207\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1625,175 L1675,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1630,190 L1639,190 L1653,160 L1644,160 L1630,190 L1639,190 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1647\" y=\"188\" font-size=\"7\" text-anchor=\"start\">Φ=5.71687</text>\n",
       "<path d=\"M1625,225 L1675,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1675,175 L1703,175 L1722,194\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1728,194 L1747,175 L1775,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1675,225 L1703,225 L1722,206\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1728,206 L1747,225 L1775,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1700,193 L1750,193 L1750,207 L1700,207 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1725\" y=\"235\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1725\" y=\"176\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1700,193 L1750,193 L1750,197 L1700,197 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1743,200 L1753,200 L1753,210 L1743,210 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1748\" y=\"207\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1775,225 L1825,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1780,240 L1789,240 L1803,210 L1794,210 L1780,240 L1789,240 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1797\" y=\"238\" font-size=\"7\" text-anchor=\"start\">Φ=3.793155</text>\n",
       "<path d=\"M1775,125 L1803,125 L1822,144\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1828,144 L1847,125 L1875,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1775,175 L1803,175 L1822,156\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1828,156 L1847,175 L1875,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1800,143 L1850,143 L1850,157 L1800,157 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1825\" y=\"185\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1825\" y=\"126\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1800,143 L1850,143 L1850,147 L1800,147 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1843,150 L1853,150 L1853,160 L1843,160 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1848\" y=\"157\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M1875,125 L1925,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1880,140 L1889,140 L1903,110 L1894,110 L1880,140 L1889,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1897\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=0.998835</text>\n",
       "<path d=\"M1875,175 L1925,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1925,125 L1953,125 L1972,144\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1978,144 L1997,125 L2025,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1925,175 L1953,175 L1972,156\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1978,156 L1997,175 L2025,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1950,143 L2000,143 L2000,157 L1950,157 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1975\" y=\"185\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"1975\" y=\"126\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M1950,143 L2000,143 L2000,147 L1950,147 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M1993,150 L2003,150 L2003,160 L1993,160 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"1998\" y=\"157\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M2025,175 L2075,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2030,190 L2039,190 L2053,160 L2044,160 L2030,190 L2039,190 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2047\" y=\"188\" font-size=\"7\" text-anchor=\"start\">Φ=0.329839</text>\n",
       "<path d=\"M2025,75 L2053,75 L2072,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2078,94 L2097,75 L2125,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2025,125 L2053,125 L2072,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2078,106 L2097,125 L2125,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2050,93 L2100,93 L2100,107 L2050,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2075\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"2075\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M2050,93 L2100,93 L2100,97 L2050,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M2093,100 L2103,100 L2103,110 L2093,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2098\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M2125,75 L2175,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2130,90 L2139,90 L2153,60 L2144,60 L2130,90 L2139,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2147\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=0.382743</text>\n",
       "<path d=\"M2125,125 L2175,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2175,75 L2203,75 L2222,94\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2228,94 L2247,75 L2275,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2175,125 L2203,125 L2222,106\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2228,106 L2247,125 L2275,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2200,93 L2250,93 L2250,107 L2200,107 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2225\" y=\"135\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"2225\" y=\"76\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M2200,93 L2250,93 L2250,97 L2200,97 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M2243,100 L2253,100 L2253,110 L2243,110 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2248\" y=\"107\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M2275,125 L2325,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2280,140 L2289,140 L2303,110 L2294,110 L2280,140 L2289,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2297\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=1.389795</text>\n",
       "<path d=\"M1975,25 L2275,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2275,25 L2303,25 L2322,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2328,44 L2347,25 L2375,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2275,75 L2303,75 L2322,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2328,56 L2347,75 L2375,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2300,43 L2350,43 L2350,57 L2300,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2325\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"2325\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M2300,43 L2350,43 L2350,47 L2300,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M2343,50 L2353,50 L2353,60 L2343,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2348\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M2375,25 L2425,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2380,40 L2389,40 L2403,10 L2394,10 L2380,40 L2389,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2397\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=4.488344</text>\n",
       "<path d=\"M2375,75 L2425,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2425,25 L2453,25 L2472,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2478,44 L2497,25 L2525,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2425,75 L2453,75 L2472,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2478,56 L2497,75 L2525,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2450,43 L2500,43 L2500,57 L2450,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2475\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<text x=\"2475\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
       "<path d=\"M2450,43 L2500,43 L2500,47 L2450,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
       "<path d=\"M2493,50 L2503,50 L2503,60 L2493,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2498\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
       "<path d=\"M2525,75 L2575,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2530,90 L2539,90 L2553,60 L2544,60 L2530,90 L2539,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
       "<text x=\"2547\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=3.753082</text>\n",
       "<path d=\"M2525,25 L2575,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2325,125 L2575,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2075,175 L2575,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1825,225 L2575,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M1575,275 L2575,275\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
       "<path d=\"M2575,25 L2590,25\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M2575,75 L2590,75\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M2575,125 L2590,125\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M2575,175 L2590,175\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M2575,225 L2590,225\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<path d=\"M2575,275 L2590,275\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
       "<text x=\"2600\" y=\"28\" font-size=\"7\" text-anchor=\"end\">0</text>\n",
       "<text x=\"2600\" y=\"78\" font-size=\"7\" text-anchor=\"end\">1</text>\n",
       "<text x=\"2600\" y=\"128\" font-size=\"7\" text-anchor=\"end\">2</text>\n",
       "<text x=\"2600\" y=\"178\" font-size=\"7\" text-anchor=\"end\">3</text>\n",
       "<text x=\"2600\" y=\"228\" font-size=\"7\" text-anchor=\"end\">4</text>\n",
       "<text x=\"2600\" y=\"278\" font-size=\"7\" text-anchor=\"end\">5</text>\n",
       "<text x=\"0\" y=\"28\" font-size=\"7\" text-anchor=\"start\">0</text>\n",
       "<text x=\"0\" y=\"78\" font-size=\"7\" text-anchor=\"start\">1</text>\n",
       "<text x=\"0\" y=\"128\" font-size=\"7\" text-anchor=\"start\">2</text>\n",
       "<text x=\"0\" y=\"178\" font-size=\"7\" text-anchor=\"start\">3</text>\n",
       "<text x=\"0\" y=\"228\" font-size=\"7\" text-anchor=\"start\">4</text>\n",
       "<text x=\"0\" y=\"278\" font-size=\"7\" text-anchor=\"start\">5</text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<drawsvg.drawing.Drawing at 0x2317cfd6320>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = 6\n",
    "unitary = pcvl.Matrix.random_unitary(m)\n",
    "mzi = (pcvl.BS() // (0, pcvl.PS(phi=pcvl.Parameter(\"φ_a\")))\n",
    "       // pcvl.BS() // (1, pcvl.PS(phi=pcvl.Parameter(\"φ_b\"))))\n",
    "linear_circuit = pcvl.Circuit.decomposition(unitary, mzi,\n",
    "                                               phase_shifter_fn=pcvl.PS,\n",
    "                                               shape=\"triangle\")\n",
    "\n",
    "print(m, \" modes triangular Boson Sampler :\")\n",
    "pcvl.pdisplay(linear_circuit, compact = True)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## MPS simulation\n",
    "\n",
    "Let us now define the MPS simulation, using the MPS backend in Perceval."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "mps = pcvl.MPSBackend()\n",
    "mps.set_circuit(linear_circuit)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We now choose the size of the matrices (the bond dimension) for our simulation."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "chi = 8\n",
    "mps.set_cutoff(chi)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And finally, we get the output probability distribution from a given input state with 3 photons."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "<thead>\n",
       "<tr><th>state        </th><th style=\"text-align: right;\">  probability</th></tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr><td>|0,0,1,0,2,0&gt;</td><td style=\"text-align: right;\">     0.089692</td></tr>\n",
       "<tr><td>|1,1,1,0,0,0&gt;</td><td style=\"text-align: right;\">     0.074157</td></tr>\n",
       "<tr><td>|0,1,0,0,0,2&gt;</td><td style=\"text-align: right;\">     0.066353</td></tr>\n",
       "<tr><td>|0,0,1,0,1,1&gt;</td><td style=\"text-align: right;\">     0.057677</td></tr>\n",
       "<tr><td>|0,1,1,0,0,1&gt;</td><td style=\"text-align: right;\">     0.057048</td></tr>\n",
       "<tr><td>|0,0,0,0,1,2&gt;</td><td style=\"text-align: right;\">     0.052347</td></tr>\n",
       "<tr><td>|0,1,1,0,1,0&gt;</td><td style=\"text-align: right;\">     0.048586</td></tr>\n",
       "<tr><td>|0,1,2,0,0,0&gt;</td><td style=\"text-align: right;\">     0.039534</td></tr>\n",
       "<tr><td>|1,1,0,0,0,1&gt;</td><td style=\"text-align: right;\">     0.034403</td></tr>\n",
       "<tr><td>|2,0,1,0,0,0&gt;</td><td style=\"text-align: right;\">     0.034118</td></tr>\n",
       "<tr><td>|1,0,2,0,0,0&gt;</td><td style=\"text-align: right;\">     0.029711</td></tr>\n",
       "<tr><td>|0,0,0,1,2,0&gt;</td><td style=\"text-align: right;\">     0.029622</td></tr>\n",
       "<tr><td>|0,0,0,0,3,0&gt;</td><td style=\"text-align: right;\">     0.027699</td></tr>\n",
       "<tr><td>|0,0,2,0,1,0&gt;</td><td style=\"text-align: right;\">     0.026586</td></tr>\n",
       "<tr><td>|0,0,0,1,1,1&gt;</td><td style=\"text-align: right;\">     0.022117</td></tr>\n",
       "<tr><td>|2,0,0,0,0,1&gt;</td><td style=\"text-align: right;\">     0.021964</td></tr>\n",
       "<tr><td>|0,1,0,1,0,1&gt;</td><td style=\"text-align: right;\">     0.020708</td></tr>\n",
       "<tr><td>|1,1,0,1,0,0&gt;</td><td style=\"text-align: right;\">     0.020591</td></tr>\n",
       "<tr><td>|1,0,0,0,0,2&gt;</td><td style=\"text-align: right;\">     0.018927</td></tr>\n",
       "<tr><td>|0,0,2,0,0,1&gt;</td><td style=\"text-align: right;\">     0.01776 </td></tr>\n",
       "</tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "n = 3\n",
    "input_state = pcvl.BasicState([1]*n + [0]*(m-n))\n",
    "mps.set_input_state(input_state)\n",
    "probs = mps.prob_distribution()\n",
    "pcvl.pdisplay(probs, max_v=20)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Certification of the MPS method :\n",
    "\n",
    "As we make an approximation by chosing the bond dimension, we have to check when does this approximation becomes good enough. Unfortunately, there is no formula giving the minimal size for a given approximation error. What we can do though is to compute the *Total Variance Distance* (TVD) between an ideal simulation of Boson Sampling, and an approximated one. To compute the ideal one, we can for instance use the *SLOS* backend on Perceval :"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "<thead>\n",
       "<tr><th>state        </th><th style=\"text-align: right;\">  probability</th></tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr><td>|0,0,1,0,2,0&gt;</td><td style=\"text-align: right;\">     0.089692</td></tr>\n",
       "<tr><td>|1,1,1,0,0,0&gt;</td><td style=\"text-align: right;\">     0.074157</td></tr>\n",
       "<tr><td>|0,1,0,0,0,2&gt;</td><td style=\"text-align: right;\">     0.066353</td></tr>\n",
       "<tr><td>|0,0,1,0,1,1&gt;</td><td style=\"text-align: right;\">     0.057677</td></tr>\n",
       "<tr><td>|0,1,1,0,0,1&gt;</td><td style=\"text-align: right;\">     0.057048</td></tr>\n",
       "<tr><td>|0,0,0,0,1,2&gt;</td><td style=\"text-align: right;\">     0.052347</td></tr>\n",
       "<tr><td>|0,1,1,0,1,0&gt;</td><td style=\"text-align: right;\">     0.048586</td></tr>\n",
       "<tr><td>|0,1,2,0,0,0&gt;</td><td style=\"text-align: right;\">     0.039534</td></tr>\n",
       "<tr><td>|1,1,0,0,0,1&gt;</td><td style=\"text-align: right;\">     0.034403</td></tr>\n",
       "<tr><td>|2,0,1,0,0,0&gt;</td><td style=\"text-align: right;\">     0.034118</td></tr>\n",
       "<tr><td>|1,0,2,0,0,0&gt;</td><td style=\"text-align: right;\">     0.029711</td></tr>\n",
       "<tr><td>|0,0,0,1,2,0&gt;</td><td style=\"text-align: right;\">     0.029622</td></tr>\n",
       "<tr><td>|0,0,0,0,3,0&gt;</td><td style=\"text-align: right;\">     0.027699</td></tr>\n",
       "<tr><td>|0,0,2,0,1,0&gt;</td><td style=\"text-align: right;\">     0.026586</td></tr>\n",
       "<tr><td>|0,0,0,1,1,1&gt;</td><td style=\"text-align: right;\">     0.022117</td></tr>\n",
       "<tr><td>|2,0,0,0,0,1&gt;</td><td style=\"text-align: right;\">     0.021964</td></tr>\n",
       "<tr><td>|0,1,0,1,0,1&gt;</td><td style=\"text-align: right;\">     0.020708</td></tr>\n",
       "<tr><td>|1,1,0,1,0,0&gt;</td><td style=\"text-align: right;\">     0.020591</td></tr>\n",
       "<tr><td>|1,0,0,0,0,2&gt;</td><td style=\"text-align: right;\">     0.018927</td></tr>\n",
       "<tr><td>|0,0,2,0,0,1&gt;</td><td style=\"text-align: right;\">     0.01776 </td></tr>\n",
       "</tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "slos = pcvl.SLOSBackend()\n",
    "slos.set_circuit(pcvl.Unitary(unitary))\n",
    "slos.set_input_state(input_state)\n",
    "probs_slos = slos.prob_distribution()\n",
    "pcvl.pdisplay(probs_slos, max_v=20)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We also have to define the TVD function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def tvd(probs1, probs2):\n",
    "    tvd = 0\n",
    "    for state, prob in probs1.items():\n",
    "        tvd += abs(prob - probs2[state])\n",
    "    return tvd\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we compute the TVD between the two simulations for different bond dimensions, going from 1 to 10."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAa8AAAEWCAYAAADRrhi8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAAsTAAALEwEAmpwYAAA4hElEQVR4nO3dd3wUdfrA8c+zqZCEmtBLEEITRYRTBA9RUNE7e8XTs2I/Pevp6c+fp573O3vDw3rYu57c2cVOUQGxULIECE0SQt8QIO35/TETbonZFLK7s5t93q9XXtmdmZ15ZnZnnvnOfOf7FVXFGGOMiSc+rwMwxhhjmsqSlzHGmLhjycsYY0zcseRljDEm7ljyMsYYE3cseRljjIk7niUvEVER6beHn/21iOSHO6ZGLHeAiMwXkYCIXNHIz+zxenpNRM4Rka+8jsM0jYhMFZE7vI4jUpp57CgUkfEhxu12XAmeVkT+LCJP7lnEDcaU665Tsvv+PRE5O0zzDrlOYZr/AhEZG675NUWDyctd2e0iUhr090g0gguKYbcfq6p+qaoDohmD63rgU1XNUtWHao8Ukc9E5IJwL9T9AdZs+23u9gj+Pp4WkWfr+NxQEdkpIh1E5FYRqXATb0BE/CLyiIh0DXe87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3aKqO3DaEuyN0zTTXiLysIhMAGq3/D/AXa7fff+MG2+NmgaX5wbFYExcsuRlWgxVnYVTysppYNKdQa+riMwViOBlVAe9rw5angAnucl3P1XtpaqL6vh8FZCsqptwSpKfARfT9M4ya+YZqXU2JmoseZkWw72PkwRsAL4ETnPvE+XglEC+qefji4FcEenrvp8YYrovcC4BIiJDgH2bEfIHwB+C7rkNq29iEckGfKr6BnAzv+yaJB9nHfq578/CKXEa0+LY2ZeJdzX3vMApyZytqlVuZYqDgO8BBa5X1aJQFRVUdYeIXAi8IyJlOMkvq45J/4HTq/AinO4wmtNp5e0496N+EBEfsBz4bT3Td3eXXXPSeWMd63Au8Jo43dR/C0xpRnzGxCxrVd4YY0zcscuGxhhj4o4lL2OMMXHHkpcxxpi4Y8nLGGNM3LHkZYwxJu5Y8jLGGBN3LHkZY4yJO/8P/D7epgNPTQ0AAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "TVD = []\n",
    "for chi in range(1,11):\n",
    "    mps.set_cutoff(chi)\n",
    "    mps.set_input_state(input_state)\n",
    "    probs_mps = mps.prob_distribution()\n",
    "    TVD.append(tvd(probs_mps, probs_slos))\n",
    "\n",
    "plt.plot(TVD)\n",
    "plt.xlabel('Bond dimension')\n",
    "plt.ylabel('TVD')\n",
    "plt.title('Evolution of the TVD between SLOS and MPS probability distributions');"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that the TVD decreases as the size of the matrices increases, untill reaching 0 for a bond dimension of 7."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## References\n",
    "\n",
    "> [1] Ulrich Schollwöck. The density-matrix renormalization group in the age of matrix product states. [Annals of Physics](https://doi.org/10.1016/j.aop.2010.09.012), 326(1):96–192, jan 2011.\n",
    "\n",
    "> [2] Changhun Oh, Kyungjoo Noh, Bill Fefferman, and Liang Jiang. Classical simulation of lossy boson sampling using matrix product operators. [Physical Review A](https://doi.org/10.1103/PhysRevA.104.022407), 104(2), aug 2021.\n",
    "\n",
    "> [3] Hui Wang, et al. Boson Sampling with 20 Input Photons and a 60-Mode Interferometer in a $10^{14}$-Dimensional Hilbert Space. [Physical Review Letters](https://link.aps.org/doi/10.1103/PhysRevLett.123.250503), 123(25):250503, December 2019. Publisher: American Physical Society."
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}